package cm.fw.log;

import java.lang.reflect.Method;

import org.apache.log4j.Logger;
import org.springframework.aop.AfterReturningAdvice;
import org.springframework.aop.MethodBeforeAdvice;

public class LoggerAdvicer implements MethodBeforeAdvice, AfterReturningAdvice {

    static Logger logger = Logger.getLogger("test1");

    @Override
    public void before(Method method, Object[] args, Object target)
            throws Exception {
        logger.info("Start Message :==> " + target.getClass().getName() + "." + method.getName()
                + "()");
    }

    @Override
    public void afterReturning(Object returnVal, Method method, Object[] args, Object target)
            throws Throwable {
        logger.info("Eend Message :==> " + target.getClass().getName() + "." + method.getName()
                + "()");
    }
}
